package org.xiaov.framework.web.interceptor;

import lombok.NonNull;
import org.springframework.web.servlet.HandlerInterceptor;
import org.xiaov.framework.core.WebContext;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

/**
 * <p>
 * 描述：设置http
 * </p>
 *
 * @author xiaovcloud
 * @since 2021/11/28 13:32
 */
public class HttpServletHandlerInterceptor implements HandlerInterceptor {

    @Override
    public boolean preHandle(@NonNull HttpServletRequest request,
                             @NonNull HttpServletResponse response,
                             @NonNull Object handler) throws Exception {
        WebContext.setHttpRequest(request);
        WebContext.setHttpRequest(response);
        return true;
    }

}
